Support for IOS Matching Metric. Introduced the mask_non_max_merge
function for handling non-maximum merging of masks
#1774
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When I used the yolo11-seg model for slice inference, I found that the merging did not work well. After analysis, it is found that for slender objects, its mask area only accounts for a small part, and the box area may be very large, so it is necessary to use mask for iou calculation.![aaa](https://private-user-images.githubusercontent.com/59189425/401532120-fc4dd285-b805-4f3f-9703-d6979fa178f8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjA2MDEsIm5iZiI6MTczOTAyMDMwMSwicGF0aCI6Ii81OTE4OTQyNS80MDE1MzIxMjAtZmM0ZGQyODUtYjgwNS00ZjNmLTk3MDMtZDY5NzlmYTE3OGY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEzMTE0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ5MWNmOWQxNjFmNWNlY2E4Mjc0ZDcxNDdkNmQzYjBhZjA0YWJjZDNjYzI4NWViYTRkYjNiODViNjFkNGVhMDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.S1sfhQ6KTgc2SIJoO2mP9TBM78JFx9ChB8Vrcx-J6MY)
![NMM-IOU10](https://private-user-images.githubusercontent.com/59189425/401533557-f6c708e3-26e5-416f-a557-90eb149ebe7d.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjA2MDEsIm5iZiI6MTczOTAyMDMwMSwicGF0aCI6Ii81OTE4OTQyNS80MDE1MzM1NTctZjZjNzA4ZTMtMjZlNS00MTZmLWE1NTctOTBlYjE0OWViZTdkLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEzMTE0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwNWIyNmY4NzQ5ZDNkYTc2MmE3MjVhYThhYmI5Yzg0MTE2ZTAxNjZlYzM2M2I4ZGQ3MzliY2RkYjBmMzJlMTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9n7Vi1IP878EFpu9w47JFLq5Dt-dL1rJeCjE4CphFOk)
![NMM-IOS10](https://private-user-images.githubusercontent.com/59189425/401534661-29124fb5-fac0-4a65-869d-a8dfd6f87c75.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjA2MDEsIm5iZiI6MTczOTAyMDMwMSwicGF0aCI6Ii81OTE4OTQyNS80MDE1MzQ2NjEtMjkxMjRmYjUtZmFjMC00YTY1LTg2OWQtYThkZmQ2Zjg3Yzc1LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEzMTE0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyYzdmMjg4ZmUzNzUyNmM1Y2M5NDdiZDVhMjMzOGFkN2U0YjM4ZWIxNDQ2Njc5ZTBjNjQxYjc3YThhNjAzMmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.AeGYyH_52bdauNT3X741MwMmoKgbM7cf4hnzOrGjMcA)
When I implemented the mask_non_max_merge function, I found that the merge effect was still not satisfactory, as shown in the figure:
I found that the sahi library implemented the non-maximum merge algorithm of the IOS version, so I made changes to the code.
Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
Any specific deployment considerations
For example, documentation changes, usability, usage/costs, secrets, etc.
Docs